//
//  SpecificationView.h
//  WuJieLive
//
//  Created by iMac on 2017/12/1.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CounterView.h"
#import "GoodsModel.h"
#import "DetailGoodsModel.h"

typedef void(^takeInCartBlock)(DetailGoodsModel * model,NSString * num);
typedef void(^buyNowBlock)(NSString * specID,NSString *num);
typedef void(^closeBlock)(void);

@interface SpecificationView : UIView<UICollectionViewDataSource,UICollectionViewDelegate>

@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *headerImage;  //  展示图片
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;  // 优惠价
@property (weak, nonatomic) IBOutlet UILabel *oldPriceLabel; // 原价
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;  // 库存
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;

@property (nonatomic , strong) NSArray * modelArray; // 装规格名字 和  规格内容的model 里面的seletedindex用于记录哪个btn是选中状态
@property (nonatomic , strong) NSArray * detailArray; // 具体的图片、价格、库存model数组

@property (nonatomic , strong) CounterView * counterView; // 计数视图

@property (nonatomic , copy) takeInCartBlock takeInCartBlock; // 添加购物车block
@property (nonatomic , copy) buyNowBlock buyNowBlock;  // 马上购买block

@property (nonatomic , strong) NSString * maxNum;   // 保存最大库存数量
@property (nonatomic , strong) DetailGoodsModel * finalModel;
@property (nonatomic , strong) NSString * currentNum; // 当前数量

@property (nonatomic , copy)closeBlock closeBlock; 

- (void)bindData:(DetailGoodsModel *)model;

@end
